package com.atguig.e_lambda;

import java.util.Date;

public class Demo2 {
    public static void main(String[] args) {
        //创建InterC对象
        InterC ic = new InterC() {
            @Override
            public Date getTime() {
                return new Date();
            }
        };

        Date date = ic.getTime();
        System.out.println("date = " + date);//现在

        System.out.println("--------------------------");

        //创建InterC对象
        InterC ic1 =() -> new Date(0);

        Date date1 = ic1.getTime();
        System.out.println("date1 = " + date1);
    }
}
@FunctionalInterface
interface InterC{
    public abstract Date getTime();
}

